//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Example #6--Adding two integers with the Scanner class
// CS 151, 6 Apr 2009
// ECC, Spring 2009
// Niko Culevski
// This program adds two integers and uses the
// Scanner class for input and output
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

import java.util.Scanner;

public class ScannerExample
{
    public static void main(String[] args)
    {
        System.out.println("Hello out there.");
        System.out.println("I will add two numbers for you.");
        System.out.println("Enter two whole numbers on a line: ");

        int n1, n2;

        Scanner keyboard = new Scanner(System.in);
        n1 = keyboard.nextInt( );
        n2 = keyboard.nextInt( );

        System.out.print("The sum of those two numbers is: ");
        System.out.println(n1 + n2);
    }
}
